package com.ruoyi.community.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.community.mapper.CommunityComplaintMapper;
import com.ruoyi.community.domain.CommunityComplaint;
import com.ruoyi.community.service.ICommunityComplaintService;

/**
 * 投诉处理管理Service业务层处理
 *
 * @author ruoyi
 * @date 2023-10-16
 */
@Service
public class CommunityComplaintServiceImpl implements ICommunityComplaintService
{
    @Autowired
    private CommunityComplaintMapper communityComplaintMapper;

    /**
     * 查询投诉处理管理
     *
     * @param id 投诉处理管理主键
     * @return 投诉处理管理
     */
    @Override
    public CommunityComplaint selectCommunityComplaintById(Long id)
    {
        return communityComplaintMapper.selectCommunityComplaintById(id);
    }

    /**
     * 查询投诉处理管理列表
     *
     * @param communityComplaint 投诉处理管理
     * @return 投诉处理管理
     */
    @Override
    public List<CommunityComplaint> selectCommunityComplaintList(CommunityComplaint communityComplaint)
    {
        return communityComplaintMapper.selectCommunityComplaintList(communityComplaint);
    }

    /**
     * 新增投诉处理管理
     *
     * @param communityComplaint 投诉处理管理
     * @return 结果
     */
    @Override
    public int insertCommunityComplaint(CommunityComplaint communityComplaint)
    {
        return communityComplaintMapper.insertCommunityComplaint(communityComplaint);
    }

    /**
     * 修改投诉处理管理
     *
     * @param communityComplaint 投诉处理管理
     * @return 结果
     */
    @Override
    public int updateCommunityComplaint(CommunityComplaint communityComplaint)
    {
        if ("".equals(communityComplaint.getPerson()) || communityComplaint.getPerson() == null) {
            communityComplaint.setPerson("张三");
        }
        return communityComplaintMapper.updateCommunityComplaint(communityComplaint);
    }

    /**
     * 批量删除投诉处理管理
     *
     * @param ids 需要删除的投诉处理管理主键
     * @return 结果
     */
    @Override
    public int deleteCommunityComplaintByIds(Long[] ids)
    {
        return communityComplaintMapper.deleteCommunityComplaintByIds(ids);
    }

    /**
     * 删除投诉处理管理信息
     *
     * @param id 投诉处理管理主键
     * @return 结果
     */
    @Override
    public int deleteCommunityComplaintById(Long id)
    {
        return communityComplaintMapper.deleteCommunityComplaintById(id);
    }
}
